<?php include_once('header.php');?>
<div class="container ">
    <div class="box-shadow col" id="markdown"> 
		<ul class="breadcrumb">
			<?php 
			foreach($path as $p){
				echo '<li><a href="'.$p['path'].'">'.$p['title'].'</a><span class="divider">/</span></li>';
			}
			?>
			<li class="active"> <?php echo $title; ?></li>
		</ul>
        <input type="hidden" name="thelast" value="<?php echo $limitpage; ?>" id="thelast" />
        <h1 > <?php echo $h1;?></h1>
        <ul id='articles'>
            <?php foreach ($list as $re) :?>
            <li><a href="<?php echo GLOBAL_URL.$re['path'].$re['filename']?>"><?=$re['title']?></a>  <a href="<?php echo GLOBAL_URL.$re['path']; ?>"><span class="label label-success"> &gt;<?php echo $re['ctitle'] ?>&lt; </span></a> <?php echo tag_span($re['tags']);?></li>
            <?php endforeach; ?>
        </ul>
        <p><center><button id="col_add" class='btn btn-success' style='color:#fafafa;'>继续加载...</button></center></p>
<script type="text/javascript" charset="utf-8">
$(function(){
    $('#col_add').on('click',function() {
        var thisY=$(this).offset().top;
        $.getJSON(
            '/ajax_col_list/?cid=<?php echo $cid;?>&limitpage='+$('#thelast').val(),
            function(data){
                if($.isEmptyObject(data)){
                    $('#col_add').hide();
                }else{
                    str = '';
                    $.each(data,function(i,item){
                        str += "<li> <a href='"+item['path']+item['filename']+"'>"+item['title']+"</a> <a href='"+item['path']+item['filename']+"'> <span class='label label-success'> &gt; "+item['ctitle']+"&lt; </span></a>"+item['tags']+"</li>";
                    }); 
                    limitpage = $('#thelast').val()-0+20;
                    $('#thelast').val(limitpage);
                    $('#articles').append(str);
        $('body').animate({scrollTop: thisY}, 500);
                }
            }
        );
    });

}) 
</script>
<?php
/*
        <?php if(isset($ccols)): ?>
        <div class="ccols">
            <?php foreach ($ccols as $fc): ?>
            <div class="box box-shadow2">
                <h2> <?php echo $fc['title'] ?></h2> 
                <ul>
                    <?php foreach ($fc['list'] as $re) :?>
                    <li><a href="<?php echo GLOBAL_URL.$re['path'].$re['filename']?>"><?=$re['title']?></a> <?php echo tag_span($re['tags']);?> </li>
                    <?php endforeach; ?>
                </ul>
            </div>
            <?php endforeach; ?>
        </div>
        <?php endif; ?>
 */
?>
    </div> <!-- end right --> 
    <?php include_once('sides.php');?>
</div>
<?php include_once('footer.php');?>

